<?php
/**
 * 学科关联学科类别
 */

namespace Schedule\Model;

use Think\Model\RelationModel;

class SubjectRelationModel extends RelationModel {

    //定义主表
    protected $tableName = 'company_subject';
    //定义关联关系
    protected $_link = array(
        'category' => array(
            'class_name' => 'company_category',
            'mapping_type' => self::HAS_MANY, //一对多关系  
            'foreign_key' => 'subject_id',
            'mapping_fields'=>"id,name",
            'condition'=>'is_active=0'
        ),
    );

}

?>
